package me.ereach;

public class Person implements Comparable<Person> {
    private String name;
    private String gender;
    private int age;

    public Person(String name, String gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person { name; " + name + ", gender: " + gender + ", age: " + age + " }";
    }

    @Override
    public int compareTo(Person o) {
        return this.age - o.age;
    }
}
